home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 November / CHIP Kasım 1997.iso / ARACLAR / TER500 / 500TER._XE / SCRIPT.EXE / MOUSE.TSL < prev    next >
Encoding:
Text File  |  1995-08-14  |  1.6 KB  |  73 lines

  1. % -----------------------------------------------------------------------------
  2. % Mouse demonstration script                           *TERMINATE PRESCRIPTION*
  3. % -----------------------------------------------------------------------------
  4. %
  5. %  Version          : 1.00
  6. %  Filename         : MOUSE.TSL
  7. %  Company          : SerWiz Comm
  8. %  Programmer       : Joop Blokker and Bo Bendtsen
  9. %  Module created   : 14 Aug 1995
  10. %  Latest revision  : 14 Aug 1995
  11. %  Language/version : Terminate Prescription 1.00
  12. %  Remarks          : Demonstrates most mouse functions
  13. %
  14. % -----------------------------------------------------------------------------
  15.  
  16. If MouseDetected=0
  17.   PrintLn "No mouse detected, please install mouse driver"
  18.   Waitenter
  19.   TERMINATE
  20. Endif
  21.  
  22. Window 1,1,80,25,1,0,23,23,27," Mouse test "
  23. MouseWindow 2,2,79,24
  24.  
  25. Mouse 1
  26. Set OldX = 0
  27. Set OldY = 0
  28. Set Counter1 = 0       % count changes
  29. Set Counter2 = 0       % count other
  30.  
  31. GotoXY   20,1
  32. Print "Click Right Mouse Button to exit, Left to fire lasergun"
  33.  
  34. repeat
  35.   Set X = MouseX
  36.   Set Y = MouseY
  37.  
  38.   If (X <> OldX) | (Y <> OldY)
  39.     gosub Report
  40.   else
  41.     Set Counter2 = Counter2 + 1
  42.     GotoXY 1,4
  43.     Print Counter2
  44.   EndIf
  45.  
  46.   If MouseLeft=1
  47.     WriteStr X,Y,"X"
  48.     Sound 1000
  49.     Wait 10
  50.     NoSound
  51.   Endif
  52.  
  53. Until (MouseRight=1) | (keypressed=1)
  54. RemoveWindow
  55. TERMINATE
  56.  
  57. :Report
  58.     GotoXY 1,1
  59.     print OldX, "  ",OldY,"  "
  60.  
  61.     GotoXY 1,2
  62.     print X, "  ",Y,"  "
  63.  
  64.     Set Counter1 = Counter1 + 1
  65.     GotoXY 1,3
  66.     print Counter1
  67.  
  68.     Set OldX=X
  69.     Set OldY=Y
  70.  
  71. Return
  72.  
  73.